﻿/**
 * Peter
 * Created by: Peter Development Team
 *    http://peter.codeplex.com/
 * 
 * GNU General Public License version 2 (GPLv2)
 *    http://peter.codeplex.com/license
 *
 *  This code is provided on an AS IS basis, with no WARRANTIES,
 *  CONDITIONS or GUARANTEES of any kind.
 *
 **/

using System;

namespace Peter.Logic.Interfaces
{
   interface IMethodInvoker
   {
      /// <summary>
      /// Invokes methods asynchronously
      /// </summary>
      /// <param name="method">Method to be called asynchronously</param>
      /// <param name="callback">Callback method</param>
      void InvokeMethod (Action method, AsyncCallback callback);

      /// <summary>
      /// Invokes methods asynchronously
      /// </summary>
      /// <typeparam name="T">Parameter for the asynch method</typeparam>
      /// <param name="method">Method to be called asynchronously</param>
      /// <param name="t">Parameter for the asynch method</param>
      /// <param name="callback">Callback method</param>
      void InvokeMethod<T> (Action<T> method, T t, AsyncCallback callback);

      /// <summary>
      /// Invokes methods asynchronously
      /// </summary>
      /// <typeparam name="T">Parameter for the asynch method</typeparam>
      /// <typeparam name="T2">Additional parameter.</typeparam>
      /// <param name="method">Method to be called asynchronously</param>
      /// <param name="t">Parameter for the asynch method</param>
      /// <param name="t2">Additional parameter.</param>
      /// <param name="callback">Callback method</param>
      void InvokeMethod<T, T2> (Action<T, T2> method, T t, T2 t2, AsyncCallback callback);
   }
}
